package com.wzl.policy.strategyNew;

import com.wzl.policy.factory.GetBeanUtil;
import com.wzl.policy.util.FtpUtil;
import org.springframework.stereotype.Component;

/**
 * ftp实现类
 *
 * @author weizhongli
 * @since 2022-08-25 23:41
 */
@Component
public class FtpStrategy implements FileUtilStrategy{

    /**
     * 这种方式也能用
     *     private static FtpUtil ftpUtil;
     *
     *     @PostConstruct
     *     public void init(){
     *         ftpUtil = this.FtpUtils;
     *     }
     */

    //手动注入
    private FtpUtil ftpUtils = GetBeanUtil.getBean(FtpUtil.class);


    @Override
    public Boolean login(String ip, int port, String username, String password) {
        return ftpUtils.login(ip,port,username,password);
    }

}